package dao;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;

import org.springframework.orm.ibatis.SqlMapClientTemplate;

import vo.MenuVO;
import vo.SellerVO;

public class SearchDAO {

	private SqlMapClientTemplate client;
	
	public void setSqlMapClientTemplate(SqlMapClientTemplate client) {
		this.client = client;
	}
	
	public ArrayList<SellerVO> searchByLocation(String location) throws SQLException{
		return (ArrayList<SellerVO>)client.queryForList("searchByLocation", location);
	}
	
	public ArrayList<SellerVO> searchByKeyword(String keyword) throws SQLException{
		return (ArrayList<SellerVO>)client.queryForList("searchByKeyword", keyword);
	}
	
	public ArrayList<SellerVO> searchByLocationAndFoodtype(HashMap<String, String> map) throws SQLException{
		return (ArrayList<SellerVO>)client.queryForList("searchByLocationAndFoodtype", map);
	}
	
	public ArrayList<MenuVO> selectByProduct(String member_id) throws SQLException{
		return (ArrayList<MenuVO>)client.queryForList("selectByProduct", member_id);
	}
	
	public Object selectBySeller(String member_id) throws SQLException{
		return client.queryForObject("selectBySeller", member_id);
	}
	
}